import 'package:json_annotation/json_annotation.dart';

part 'store_staff_data.g.dart';

@JsonSerializable()
class StoreStaffData extends Object {
  @JsonKey(name: 'staffRoyaltyList')
  List<StaffAnalysis> staffRoyaltyList;

  @JsonKey(name: 'takeOutListSort')
  List<StaffAnalysis> takeOutListSort;

  @JsonKey(name: 'tipListSort')
  List<StaffAnalysis> tipListSort;

  @JsonKey(name: 'staffCustomList')
  List<StaffAnalysis> staffCustomList;

  @JsonKey(name: 'saleListSort')
  List<StaffAnalysis> saleListSort;

  @JsonKey(name: 'bookListSort')
  List<StaffAnalysis> bookListSort;

  @JsonKey(name: 'commentList')
  List<StaffAnalysis> commentList;

  @JsonKey(name: 'staffCommissionList')
  List<StaffAnalysis> staffCommissionList;

  @JsonKey(name: 'couponIncomeRank')
  List<StaffAnalysis> couponIncomeRank;

  StoreStaffData(
    this.staffRoyaltyList,
    this.takeOutListSort,
    this.tipListSort,
    this.staffCustomList,
    this.saleListSort,
    this.staffCommissionList,
    this.bookListSort,
    this.commentList,
  );

  factory StoreStaffData.fromJson(Map<String, dynamic> srcJson) => _$StoreStaffDataFromJson(srcJson);

  Map<String, dynamic> toJson() => _$StoreStaffDataToJson(this);
}

@JsonSerializable()
class StaffAnalysis {
  int waiterId;

  String waiterName;

  int amount;

  int totalFee;

  String highRate;

  int bookTableNum;

  int count;

  int tip;

  StaffAnalysis({
    this.waiterId,
    this.waiterName,
    this.amount,
  });

  factory StaffAnalysis.fromJson(Map<String, dynamic> srcJson) => _$StaffAnalysisFromJson(srcJson);

  Map<String, dynamic> toJson() => _$StaffAnalysisToJson(this);
}
